﻿using System.Collections.Generic;

namespace DataScripter.Excel.Formatters
{
	class MultiFormatter : ICellFormatter
	{
		public IEnumerable<ICellFormatter> Formatters { get; set; }

		public MultiFormatter(IEnumerable<ICellFormatter> formatters)
		{
			Formatters = formatters;
		}

		public MultiFormatter(ICellFormatter formatter)
		{
			Formatters = new[] { formatter };
		}

		#region Implementation of ICellFormatter

		public void Format(ICell cell)
		{
			foreach (ICellFormatter formatter in Formatters)
			{
				formatter.Format(cell);
			}
		}

		#endregion
	}
}
